<html>
	<head>
		<title>MB_menu</title>
		<meta name="layout" content="main" />
		<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
		<script type="text/javascript" src="inc/jquery.metadata.js"></script>
		<script type="text/javascript" src="inc/mbMenu.js"></script>
		<script type="text/javascript" src="inc/jquery.hoverIntent.js"></script>
		<link rel="stylesheet" type="text/css" href="css/menu1.css" title="styles1"  media="screen" />
	
		<style type="text/css">
			body .style a{
				color:gray;
				font-family:sans-serif;
				font-size:13px;
				text-decoration:none;
			}
		</style>
	
		<script type="text/javascript">
		$(function(){
			$(".myMenu").buildMenu(
			{
				template:"menuVoices.html",
				additionalData:"pippo=1",
				menuWidth:200,
				openOnRight:false,
				menuSelector: ".menuContainer",
				containment:"wrapper",
				iconPath:"ico/",
				hasImages:true,
				fadeInTime:100,
				fadeOutTime:300,
				adjustLeft:2,
				minZindex:"auto",
				adjustTop:10,
				opacity:.95,
				shadow:true,
				closeOnMouseOut:true,
				closeAfter:1000
			});
		});
	</script>
	</head>
	<body>
		<div style="background:#FF6600 url(images/header_bgnd.jpg); padding:10px; color:white;font-size:16px; font-family:'Courier New', Courier, mono"> mbMenu</div>
	
		<div id="wrapper" style="width:980px;height:550px; border:1px dotted red; position:absolute; left:250px; top:100px">
	
			<table width="100%"  border="0" cellpadding="0" cellspacing="0" bgcolor="#EDEDED" ><!--style="position:absolute;bottom:0"-->
				<tr>
					<td valign="bottom">
						<table  border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="container">
							<tr>
								<td class="myMenu" align="right">
	
									<!-- start horizontal menu -->
	
									<table class="rootVoices" cellspacing='0' cellpadding='0' border='0'><tr>
										<g:each in="${templar.Menu.findByParentIsNull().children}" var="firstLevel">
											<td class="rootVoice {menu: 'menu_${firstLevel.id}'}">${firstLevel.name}</td>
										</g:each>
									</tr></table>
	
									<!-- end horizontal menu -->
	
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</div>
		
		<%-- 列出所有的菜单组 --%>
		<g:each in="${templar.Menu.executeQuery('from templar.Menu m where m.parent is not null and exists elements(m.children)')}" var="menuItem">
			<div id="menu_${menuItem.id}" class="menu">
				<g:if test="${menuItem.tooltip}">
					<a rel="text" >${menuItem.tooltip}</a>
				</g:if>
				<g:each in="${menuItem.children}" var="subItem">
					<g:set var="ctext" value="{}" />
					<g:if test="${subItem.children}">
						<g:set var="ctext" value="{menu: 'menu_${subItem.id}'}" />
					</g:if>
					<g:if test="${subItem.controller}">
						<g:link controller="${subItem.controller}" 
							action="${subItem.action?subItem.action:'index'}" 
							title="${subItem.tooltip.encodeAsHTML()}"
							class="${ctext}">
							<span>${subItem.name.encodeAsHTML()}</span>
						</g:link>
					</g:if>
					<g:else>
						<a href="#" class="${ctext}">${subItem.name.encodeAsHTML()}</a>
					</g:else>
				</g:each>
			</div>
		</g:each>
	</body>
</html>